package com.sdyc.ndmp.cls.model;

import java.io.Serializable;

/**
 * 搜索字段枚举类
 */
public enum KeyRuleRangeEntity implements Serializable {

    /**
     * 标题
     */
    TITLE("TITLE"),

    /**
     * 正文
     */
    CONTENT("CONTENT"),

    /**
     * 全文
     */
    FULLTEXT("FULLTEXT"),

    /**
     * 影视播放源
     */
    SOURCE("SOURCE");

    private final static long serialVersionUID = 1L;

    private String name;

    KeyRuleRangeEntity(String name) {
        this.name = name;
    }

    public static KeyRuleRangeEntity convertToRuleTypeEntity(String value) {
        if (value.equals("TITLE")) {
            return TITLE;
        } else if (value.equals("CONTENT")) {
            return CONTENT;
        } else if (value.equals("FULLTEXT")) {
            return FULLTEXT;
        }else if (value.equals("SOURCE")) {
            return SOURCE;
        }

        return null;
    }
}